<admintpl file="header" />
<script type='text/javascript' src="__PUBLIC__/ckeditor/ckeditor.js"></script>

</head>
<body>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
			<li><a href="{:U('Shop/index')}" target="_self">{:L('SHOP_SHOP_NAME')}</a></li>
			<li class="active"><a href="#A" data-toggle="tab">{:L('SHOP_SHOP_EDIT')}</a></li>
		</ul>
		<form class="form-horizontal js-ajax-form" enctype="multipart/form-data" action="{:U('Shop/edit_post')}" method="post">
			<div class="tabbable">
				<div class="tab-content">
					<div class="tab-pane active" id="A">
						<fieldset>
							<input type='hidden' name='id' value='{$data.id}'/>
							<div class="control-group">
								<label class="control-label">{:L('SHOP_NAME')}</label>
								<div class="controls">
									<input type="text" name="shopName" value="{$data.shopname}"><span
										class="form-required">*</span>
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">{:L('SHOP_NUMBER')}</label>
								<div class="controls">
									<input type="text" name="number" value="{$data.number}"><span
										class="form-required">*</span>
								</div>
							</div>
							
							<div class="control-group">
								<label class="control-label">{:L('SHOP_SHOP_ADDRESS')}</label>
								<div class="controls">
									<input type='text' name='address' value="{$data.address}"/>
								</div>
							</div>
							
							<div class="control-group">
								<label class="control-label">{:L('SHOP_FLOOR_NAME')}</label>
								<div class="controls">
									<Volist name='floors' id='vo'>
										<label class='radio inline '>
											<input type='radio' <if condition="$vo['id'] eq $data['floorid']">checked='checked'</if> name='floorID' value='{$vo.id}'>{$vo.name}
										</label>
									</Volist>
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">{:L('SHOP_FORMAT_NAME')}</label>
								<div class="controls">
									<Volist name='formats' id='vo'> 
										<label class='checkbox inline '>
										<input type='checkbox' <if condition="in_array($vo['id'],explode(',',$data['formatid']))">checked='checked'</if> name='formatID[]' value='{$vo.id}'>{$vo.name}
										</label>
									</Volist>
								</div>
							</div>
							
							<div class="control-group">
								<label class="control-label">铺位首拼</label>
								<div class="controls">
									<input type='text' name='sp' value="{$data.sp}"/>
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">铺位全拼</label>
								<div class="controls">
									<input type='text' name='qp' value="{$data.qp}"/>
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">铺位简拼</label>
								<div class="controls">
									<input type='text' name="jp" value="{$data.jp}"/>
								</div>
							</div>
							
							<div class="control-group">
								<label class="control-label">{:L('SHOP_SHOP_ATTAC')}</label>
								<div class="controls">
									<input  type='file' name='attac' value=''/>
									<if condition="!empty($data['savepath'])">
										<img src='uploads/{$data.savepath}/{$data.savename}' style='height:100px;'/>
									<else/>
										<img src='uploads/shop/2017-03-13/m_58c645c146a0b.jpg' style='height:100px;'/>
									</if>
								</div>
							</div>
							
							
							<div class="control-group">
								<label class="control-label">{:L('SHOP_SHOP_CONTENT')}</label>
								<div class="controls">
									<textarea name='content' id='content'  class="ckeditor" >{$data.content}</textarea>
									<script type="text/javascript">
								   	 CKEDITOR.replace('content',{toolbar:'mybar'});
								</script>
								</div>
							</div>
						</fieldset>
					</div>
				</div>
			</div>
			<div class="form-actions">
				<button class="btn btn-primary js-ajax-submit" type="submit">{:L('EDIT')}</button>
				<a class="btn" href="javascript:history.back(-1);">{:L('BACK')}</a>
			</div>
		</form>
	</div>
	<script type='text/javascript'>
		$(function() {
			function CKupdate() {
				for (instance in CKEDITOR.instances)
					CKEDITOR.instances[instance].updateElement();
			}
			$(".js-ajax-submit").click(function() {
				CKupdate();
			});
		});
	</script>
	<script type="text/javascript" src="__PUBLIC__/js/common.js"></script>
	
	
</body>
</html>